package model.commands.keyboard;

public class KeyboardMultiplePress extends KeyboardType {
	private Integer[] keyCodes = null;

	@Override
	public void execute() {
		try {
			int[] keyCodesAux = new int[getKeyCodes().length];
			for(int i = 0; i<getKeyCodes().length; i++){
				keyCodesAux[i] = getKeyCodes()[i].intValue();
			}
			doType(keyCodesAux);
			propertyChangeSupport.firePropertyChange(EXECUTION_FINISHED, null, this);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Override
	public void setParams(Object[] params) {
		setKeyCodes((Integer[]) params);
	}

	public Integer[] getKeyCodes() {
		return keyCodes;
	}

	public void setKeyCodes(Integer[] keyCodes) {
		this.keyCodes = keyCodes;
	}

}
